Task Property

Task Parallel System.Threading

Gets the Task<(Of <(TResult>)>) created by this TaskCompletionSource<(Of <(TResult>)>).

Namespace:  System.Threading.Tasks
Assembly:  System.Threading (in System.Threading.dll)

Syntax

Visual Basic (Declaration)
Public ReadOnly Property Task As Task(Of TResult)
C#
public Task<TResult> Task { get; }

Remarks

This property enables a consumer access to the Task<(Of <(TResult>)>) that is controlled by this instance. The SetResult(TResult), SetException(Exception), SetException(IEnumerable<(Of <(Exception>)>)), and SetCanceled()()() methods (and their "Try" variants) on this instance all result in the relevant state transitions on this underlying Task.

See Also